the_count = [1, 2, 3, 4, 5]
fruits = ['apples', 'oranges', 'pears', 'apricots']
change = [1, 'pennies', 2, 'dimes', 3, 'quarters']

for number in the_count
  puts "This is cout #{number}"
end
# number 可以用任何其他的词或字母代替，只代表the_count里面的元素
fruits.each do |fruit|
  puts "A fruit of type: #{fruit}"
end
# x.each do |x| end 的用法，将x中的每一个元素单独列出
for e in change
  puts "I got #{e}"
end

elements = []

for i in (0..5)
  puts "Adding #{i} to the list."
  elements.push(i)
end
# (0..5)代表(1, 2, 3, 4, 5) elements.push(i) 将（0..5）里的元素添加到element中，所以到最后elemets = [1, 2, 3, 4, 5]
for i in elements
  puts "Element was: #{i}"
end
